package dataService.approveDataService;

import java.util.ArrayList;

import vo.Limitation;
import dataService.chooseDataService.ChooseHeaders;

public class PlatformLimitation {
	public static String getCondition(ArrayList<Limitation> limit){
		ArrayList<String> conditionList = new ArrayList<String>();
		int i=0;
		for(Limitation l:limit){
			String temp = "";
			temp = PlatformHeaders.getHeaders(l.getFactor())+"='"+l.getValue()+"'";
			if(temp == null)
				return null;
			conditionList.add(temp);
		}
		String condition = "";
		for(i=0;i<conditionList.size()-1;i++){
			condition+=conditionList.get(i)+" and ";
		}
		condition+=conditionList.get(i);
		return condition;
	}
}
